import React, { Component } from 'react'
import { NavLink } from 'react-router-dom';

export default class List extends Component {
    constructor() {
        super();
        this.state = {
            list: [
                {name: '下雨天'},
                {name: '晴天'},
                {name: '阴天'},
                {name: '第一天'},
            ]
        }
    }
  render() {
    return (
      <div>
          <p>动态路由</p>
          {
              this.state.list.map((itme, index) => {
                  return (
                      <NavLink key={index} to={'/detail/'+itme.name}>{itme.name}</NavLink>
                  )
              })
          }
      </div>
    )
  }
}
